package com.ywb.ex09.tools;

import javax.swing.*;
import java.awt.*;

public class MyTools {
    static Toolkit kit=Toolkit.getDefaultToolkit();
    public static  void setTitleImage(JFrame frame, String  titleIconPath){
        frame.setIconImage(kit.createImage(titleIconPath));
    }
    public static void center(Component c){
        int x=(kit.getScreenSize().width-c.getWidth())/2;
        int y=(kit.getScreenSize().height-c.getHeight())/2;
        c.setLocation(x,y);
    }
}
